﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="publishorder.aspx.cs" Inherits="Html5.shop.publishorder" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <title><%= SectionProxyData.GetSetValue(3) %></title>
    <link type="text/css" rel="stylesheet" href="/css/common.css" />
    <link type="text/css" rel="stylesheet" href="/css/style.css" />
    <link type="text/css" rel="stylesheet" href="/css/page.css" />
    <link href="../css/sweetalert.css" rel="stylesheet" />
    <link href="../css/shopcenter.css" rel="stylesheet" />
    <link href="../css/pictip.css" rel="stylesheet" />
    <link href="/css/mobiscroll.custom-2.17.0.min.css" rel="stylesheet" type="text/css" />


    <script src="/javascript/jquery.js"></script>

    <script src="/javascript/mobiscroll.custom-2.17.0.min.js" type="text/javascript"></script>



    <style type="text/css">
        .time {
            width: 100%;
        }

            .time .w_txt, .add_order_de .w_txt {
                width: 80%;
            }

        @media screen and (max-width: 320px) {
            .time .w_txt, .add_order_de .w_txt {
                width: 75%;
            }
        }




        .title_tit {
            background: #f9f9f9;
            color: #666;
            font-size: 14px;
            border-bottom: none;
            border-top: none;
            padding-left: 15px;
            height: 30px;
            line-height: 30px;
        }
    </style>


</head>
<body id="page_allMenu">




    <div class="page">
        <div id="page_title">
            <a href="index.aspx" class="back top_left"><span style="padding-left: 15px; width: 50px; position: absolute; top: -10px; font-size: 14px;">返回</span></a>
            <h1>我要下单</h1>
        </div>

        <form method="post" action="/ajaxHandler.ashx?method=publishorder" id="addform">

            <input type="hidden" id="hfcityname" runat="server" value="全国" />
            <input type="hidden" id="hftid" value="0" runat="server" />
            <input type="hidden" id="hftip" name="hftip" value="0" />
            <input type="hidden" id="OrderAttach" name="OrderAttach" value="" />
            <input type="hidden" id="hidlat" name="hidlat" value="0" />
            <input type="hidden" id="hidlng" name="hidlng" value="0" />
            <input type="hidden" id="hidhasaddr" name="hidhasaddr" value="0" />
            <input type="hidden" id="method" name="method" value="publishorder" />
            <input type="hidden" id="tbcardpay" name="tbcardpay" value="0" />
            <input type="hidden" id="tbshopdiscountmoney" name="tbshopdiscountmoney" value="0" />
            <input type="hidden" id="hfisselfdispatch" value="0" />

             <input type="hidden" id="hfmymoney" value="0" runat="server" />

            <div class="container">
                <ul class="my_order_list publishorderdata">
                    <li>
                        <div class="order-tit">
                            <span class="time"><strong>手机</strong><input type="text" reg="\S" tip="请填写收货人手机" class="w_txt" value="" id="OrderComm" name="OrderComm" onkeyup="telcheck()" placeholder="请填写收货人手机" /></span>
                        </div>
                        <div class="order-tit">
                            <span class="time">
                                <span style="display: none;">
                                    <strong>商品</strong><input type="text" style="width: 60px;" reg="^[-+]?\d+(\.\d+)?$" tip="商品金额错误,请输入数字" onblur="culSenFee()" id="tbPrice" name="tbPrice" class="w_txt" value="0" placeholder="请填写商品金额" /></span>
                                <strong style="display:none;">代收</strong><input  type="text" style="width: 60px; display:none;" reg="^[-+]?\d+(\.\d+)?$" tip="代收款错误,请输入数字" onblur="culSenFee()" id="tbAdvance" name="tbAdvance" class="w_txt" value="0" placeholder="请填写代收款" />




                                <i>
                                    <input name="ddlSystemUserId" type="radio" checked="checked" value="0">无券</i><input name="ddlSystemUserId" type="radio" value="1">有券</span>

                        </div>
                        <div class="add_detail" style="position: relative;">
                            <span class="time" style="float: none;"><strong>收货地址</strong><input type="text" class="w_txt" value="" id="tbaddress" onclick="showmap()" name="tbaddress" reg="\S" tip="请输入地址定位" readonly="readonly" placeholder="地址定位" style="margin-left: 10px;" /><a class="change_add" href="javascript:" onclick="showmap()" style="position: absolute; right: 20px;">更改</a>
                                <div class="add_order_de" style="border-top: 1px solid #dfdfdf;">
                                    <input type="text" class="w_txt" value="" style="margin-left: 10px; width: 90%;" id="tbaddressdetail" name="tbaddressdetail" placeholder="街道 小区 楼号 门牌号" />
                                </div>
                            </span>
                        </div>

                        <div class="order-tit" id="distancebox" style="display: none; background-color: #ddd; margin-right: 15px;">
                            <span class="time"><strong style="padding-left: 69px; color: blue;" id="distancemsg">距发货地0KM</strong></span>
                        </div>

                        <div class="order-tit" style="">
                            <span class=""><strong>出餐时间</strong><input type="text" class="w_txt" value="" style="margin-left: 10px;" placeholder="选择时间" id="tbSentTime" name="tbSentTime" reg="\S" tip="请选择时间" /></span>
                        </div>
                        <div class="order-tit">
                            <span class="time"><strong style="float: left;">捎句话</strong><span id="remarkbox" class="w_txt" style="color: #ccc; display: block;" onclick="showremarkbox()" />选填</span>
                            <div class=" clear"></div>
                        </div>
                        <div class="order-tit">
                            <strong>配送费（元）</strong><a class="shipment_rule"
                                href="javascript:" onclick="showlaw()">配送费规则</a><i class="shipment_sum" id="lbsendfee">0</i>
                        </div>
                        <div class="order-tit" style="position: relative; border-bottom: none;">
                            <strong>愿加小费（元）</strong>
                            <div class="cart_con">
                                <a class="cicon subitem">-</a>
                                <span class="cicon mid" id="tipbox">0</span>
                                <a class="cicon additem">+</a>
                            </div>
                        </div>
                        <div class="shipment_prompt" style="border-bottom: none;">
                            <p>（加点小费，会让爆走配送接单更快哦～）</p>
                        </div>
                    </li>
                </ul>

                <div class="view_back_con" id="btn_box">
                    <div style="margin-bottom: 20px;">
                        <input type="button" id="btsubmit" value="发布订单(客服调度)" class="view_back_btn" data-ajax="false" />
                    </div>

                    <div  style="display:none;">

                        <div runat="server" id="selfdispach">
                            <input type="button" id="btSaveself" value="发布订单(发给附近配送员)" class="view_back_btn" data-ajax="false" />
                        </div>

                    </div>

                </div>
            </div>
        </form>
    </div>

    <div class="mModal sweet-overlay" style="z-index: 900; display: none;">
    </div>
    <div class="mDialog freeSet" style="z-index: 901; display: none; margin-top: 0px;"
        data-ffix-top="99" id="sendfeelaw">
        <div class="content">


            <ul class="my_order_list">
                <asp:Repeater runat="server" ID="rptorder">
                    <ItemTemplate>
                        <li style="border: none;">
                            <div>

                                <div class="order-info" style="background: none;">
                                    <p class="grey">计费类型：<%# Hangjing.WebCommon.WebHelper.shopSendFeeType(Eval("sn1"),Eval("point")) %></p>
                                    <div style="<%# Convert.ToInt32(Eval("sn1")) == 2 ? "": "display:none"  %>">
                                        <asp:Repeater runat="server" ID="rptlaw" DataSource='<%# getShopLaw() %>'>
                                            <ItemTemplate>
                                                <p class="grey">从<%# Eval("distancestart")%>公里到<%# Eval("distanceend")%>公里，基础运费：<%# Eval("ReveFloat1")%>元，每公里增加<%# Eval("sendmoney")%>元</p>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </div>



                                </div>
                            </div>
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
            </ul>



        </div>
        <a class="x" href="javascript:void(0)">X</a>
    </div>

    <div class="mDialog freeSet" style="z-index: 901; display: none; margin-top: 0px;"
        data-ffix-top="99" id="remarktip">
        <div class="content">
            <h2>捎句话</h2>
            <div class="view_back">
                <p>
                    <textarea name="tbremark" id="tbremark" class="view_back_text" placeholder="请输入备注信息，如：不要辣等"></textarea>
                </p>

                <p>
                    <asp:Repeater runat="server" ID="rptfastremark">
                        <ItemTemplate>
                            <a href="javascript:;" onclick="settag(this)" mytag="<%# Eval("classname") %>">
                                <%# Eval("classname") %></a>
                        </ItemTemplate>
                    </asp:Repeater>
                </p>
            </div>

            <div class="view_back_con">
                <input type="button" value="完成" onclick="completeremark()" class="view_back_btn" data-ajax="false" />
            </div>

        </div>
        <a class="x" href="javascript:void(0)">X</a>
    </div>

    <div class="mDialog freeSet" style="z-index: 901; display: none; top: 50px; height: 80%;"
        data-ffix-top="99" id="maptipbox">
        <div class="content">
            <b></b>
            <div>
                <div class="btn" style="margin: 10px; position: relative; margin-top: 20px;">
                    <input name="keyaddress" class="commonyinput" type="text" id="keyaddress" placeholder="请输入您的位置">
                </div>

                <div style="margin-top: 10px;">




                    <div class="title_tit">历史地址</div>

                    <div id="addressbox" class="geo-search-results ng-scope ui_show ng-hide">
                    </div>
                </div>


            </div>
        </div>
        <a class="x" href="javascript:void(0)">X</a>
    </div>



    <div class="mDialog freeSet" style="z-index: 901; display: none; margin-top: 0px;"
        data-ffix-top="99" id="loadingbox">
        <div class="content">
            <div class="loading-style-1">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </div>

        </div>

    </div>

    <script id="addressTemplate" type="text/x-jsrender">
        {{for #data}}
            <div class="geo-search-result ng-scope" style="line-height: 30px;">
                <a class="gsr-detail" href="javascript:" onclick="setaddress('{{:Lat}}','{{:Lng}}','{{:Address}}',1)">

                    <div class="spot ng-binding">{{:Address}}</div>

                </a>
            </div>
        {{/for}}
        
    </script>





</body>
</html>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=fMnzyhYs0D1cBEl5iGMQ0Dlg"></script>
<script src="/javascript/eventwrapper.min.js"></script>
<script src="../javascript/publishorder.js?v=2016070955"></script>
<script src="../javascript/jquery.form.js"></script>
<script src="../javascript/jCommon.js"></script>
<script src="../javascript/sweetalert.min.js"></script>
<script src="../javascript/jsrender.js"></script>

<script type="text/javascript">

    $('#tbSentTime').mobiscroll().time({
        theme: $.mobiscroll.defaults.theme,     // Specify theme like: theme: 'ios' or omit setting to use default 
        mode: "scroller",       // Specify scroller mode like: mode: 'mixed' or omit setting to use default 
        display: "bottom", // Specify display mode like: display: 'bottom' or omit setting to use default 
        lang: "zh",       // Specify language like: lang: 'pl' or omit setting to use default
        timeFormat: 'HH:ii',
        stepMinute: 5  // More info about stepMinute: http://docs.mobiscroll.com/2-17-0/datetime#!opt-stepMinute

    });


    $(document).ready(function () {

        $("#tbSentTime").val(new Date().format("HH:mm"));

        var hfmymoney = parseFloat($("#hfmymoney").val());

        if (hfmymoney <= - 50) {
            $("#btn_box").hide();
            swal({
                title: "",
                text: "余额不足，请充值后再提交订单",
                type: "warning",
                confirmButtonText: "确定",
                closeOnConfirm: false
            },
                function () {
                    gourl("index.aspx");
                });
        }

    })




</script>
